<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
BMI: <input type="text" id="input1"><button id="btn1" onclick="test01()">判断</button>
结果：
<script>
    function test01(){
        var num1 = parseInt(document.getElementById('input1').value);
        if(num1>35){
            document.write('非常肥胖');
        }else if(num1>30){
            document.write('肥胖');
        }else if(num1>25){
            document.write('体重过重');
        }else if(num1>20){
            document.write('体重适中');
        }else if(num1<20){
        }
    }
</script>

</body>
</html>